package com.mlnx.bluwifi.session;

import com.mlnx.bluwifi.manager.ConDeviceManage;

import org.shan.mq.session.core.MemmerySessionManager;
import org.shan.mq.session.core.Session;

/**
 * Created by amanda.shan on 2019/11/18.
 */
public class WifiBluMemmerySessionManager extends MemmerySessionManager {

    @Override
    public synchronized void addSession(Session session) {

        String clientId = session.getClientId();
        super.addSession(session);

        ConDeviceManage.getInstance().setApStatus(clientId.subSequence(0, clientId.length() - 2).toString(), true);
    }

    @Override
    public synchronized void removeSession(Session session) {
        super.removeSession(session);

        ConDeviceManage.getInstance().setApStatus(session.getClientId(), false);
    }

    @Override
    public String getName() {
        return "WifiBluMemmerySessionManager";
    }
}
